#define  _CRT_SECURE_NO_WARNINGS 1

#include"vector.h"

namespace zl
{
	void Test1() {
		vector<int> v;

		v.push_back(1);
		v.push_back(2);
		v.push_back(3);
		v.push_back(4);
		v.push_back(5);
		v.push_back(5);
		v.push_back(5);
		v.push_back(5);
		v.push_back(5);
		v.push_back(5);
		v.push_back(5);
		v.push_back(5);


		for (size_t i = 0; i < v.size(); i++)
		{
			cout << v[i] << " ";
		}
		cout << endl;

		cout << v.capacity() << endl;


		for (auto e:v)
		{
			cout << e << " ";
		}

		cout << endl;
	}



	void Test2() {
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		for (auto e : v1) cout << e << " "; cout << endl;

		v1.pop_back();
		for (auto e : v1) cout << e << " "; cout << endl;
	}

	void Test3() {
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		vector<int>::iterator pos = find(v1.begin(), v1.end(), 2);
		if (pos != v1.end()) {
			v1.insert(pos, 20);
		}

		for (auto e : v1) cout << e << " "; cout << endl;
	}

	void Test4() {
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		vector<int>::iterator pos = find(v1.begin(), v1.end(), 2);
		if (pos != v1.end()) {
			v1.erase(pos);
		}

		for (auto e : v1) cout << e << " "; cout << endl;
	}

	void Test5()
	{
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);

		vector<int> v2 = v1;

		for (auto e : v2)
		{
			cout << e << " ";
		}

		cout << endl;
	}
}


int main() {
	//zl::Test1();
	//zl::Test2();
	//zl::Test3();
	//zl::Test4();
	zl::Test5();
}